---
layout: m1x_soap
title: Customer
---

<h2><a name="MAPI-Customer-Module%3AMageCustomer"></a>Module: Mage_Customer</h2>

<p>The Mage_Customer module allows you to create, retrieve, update, and delete customers and customer addresses.</p>

<h4><a name="MAPI-Customer-Customer"></a>Customer</h4>

<p>Allows you to create, retrieve, update, and delete data about customers.</p>

<p><b>Resource Name</b>: customer</p>

<p><b>Methods</b>:</p>
<ul>
	<li><a href="customer.list.html" title="customer.list">customer.list</a> &#45; Retrieve the list of customers</li>
	<li><a href="customer.create.html" title="customer.create">customer.create</a> &#45; Create a new customer</li>
	<li><a href="customer.info.html" title="customer.info">customer.info</a> &#45; Retrieve the customer data</li>
	<li><a href="customer.update.html" title="customer.update">customer.update</a> &#45; Update the customer data</li>
	<li><a href="customer.delete.html" title="customer.delete">customer.delete</a> &#45; Delete a required customer</li>
</ul>


<h4><a name="MAPI-Customer-Faults"></a>Faults</h4>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 100 </td>
<td> Invalid customer data. Details in error message. </td>
</tr>
<tr>
<td> 101 </td>
<td> Invalid filters specified. Details in error message. </td>
</tr>
<tr>
<td> 102 </td>
<td> Customer does not exist. </td>
</tr>
<tr>
<td> 103 </td>
<td> Customer not deleted. Details in error message. </td>
</tr>
</tbody></table>


<h4><a name="MAPI-Customer-Examples"></a>Examples</h4>

<h5><a name="MAPI-Customer-Example1.View%2Ccreate%2Cupdate%2Canddeleteacustomer"></a>Example 1. View, create, update, and delete a customer</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: java; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');

$newCustomer = array(
    'firstname'  =&gt; 'First',
    'lastname'   =&gt; 'Last',
    'email'      =&gt; 'test@example.com',
    //for my version of magento (1.3.2.4) you SHOULD NOT
    // hash the password, as in:
    // 'password_hash' =&gt; 'password'
    'password_hash'   =&gt; md5('password'),
    // password hash can be either regular or salted md5:
    // $hash = md5($password);
    // $hash = md5($salt.$password).':'.$salt;
    // both variants are valid
    'store_id'   =&gt; 0,
    'website_id' =&gt; 0
);

$newCustomerId = $proxy-&gt;call($sessionId, 'customer.create', array($newCustomer));

// Get new customer info
var_dump($proxy-&gt;call($sessionId, 'customer.info', $newCustomerId));


// Update customer
$update = array('firstname'=&gt;'Changed Firstname');
$proxy-&gt;call($sessionId, 'customer.update', array($newCustomerId, $update));

var_dump($proxy-&gt;call($sessionId, 'customer.info', $newCustomerId));

// Delete customer
$proxy-&gt;call($sessionId, 'customer.delete', $newCustomerId);</pre>
		</div>
</div></div>


<h4><a name="MAPI-Customer-CustomerGroups"></a>Customer Groups</h4>

<p>Allows you to retrieve the customer groups.</p>

<p><b>Resource Name</b>: customer_group</p>

<p><b>Methods</b>:</p>
<ul>
	<li><a href="customer_group.html" title="customer_group.list">customer_group.list</a> &#45; Retrieve the list of customer groups</li>
</ul>
